﻿namespace Singleton.Sample.Implementations
{
    /// <summary>
    /// Static constructor tells the compiler to lazy-load the type-initialization (by NOT marking the class with beforeFieldInit)
    /// and runs only ONCE per AppDomain (what makes it Thread-safe).
    /// </summary>
    public sealed class Singleton_3_ThreadSafeWithoutLock
    {
        private static readonly Singleton_3_ThreadSafeWithoutLock instance = new Singleton_3_ThreadSafeWithoutLock();

        static Singleton_3_ThreadSafeWithoutLock() { }
        private Singleton_3_ThreadSafeWithoutLock() { }

        public Singleton_3_ThreadSafeWithoutLock Instance
        {
            get
            {
                return instance;
            }
        }
    }
}